package com.coding.controller;

import com.coding.base.pojo.BaseModel;
import com.coding.base.pojo.PageQueryModel;
import com.coding.service.PointService;
import com.wordnik.swagger.annotations.ApiOperation;
import com.wordnik.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

/**
 * @auther wangchenghao
 * @date 2020/9/19
 **/
@Controller
@ResponseBody
@RequestMapping("point")
public class PointController {
    @Autowired
    PointService pointService;

    @ApiOperation("根据user_id查询积分详情")
    @RequestMapping(value = "/getPointById", method = {RequestMethod.GET})
    public BaseModel getPoetById(@ApiParam("user_id") @RequestParam(value = "user_id", required = true) int user_id,
                                    @ModelAttribute PageQueryModel pageQueryModel) throws Exception {
        BaseModel model = new BaseModel();
        pointService.getPoint(user_id, pageQueryModel, model);
        return model;
    }
}
